/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Juanan
 */
@Entity
@Table(name = "cit_city")
@NamedQueries(
{
    @NamedQuery(name = "CitCity.findAll", query = "SELECT c FROM CitCity c")
})
public class CitCity implements Serializable
{
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "CIT_ID")
    private Integer citId;
    @Column(name = "CIT_CODE")
    private String citCode;
    @Basic(optional = false)
    @Column(name = "CIT_NAME")
    private String citName;
    @JoinColumn(name = "CON_ID", referencedColumnName = "CON_ID")
    @ManyToOne(optional = false)
    private ConCountry conId;

    public CitCity()
    {
    }

    public CitCity(Integer citId)
    {
        this.citId = citId;
    }

    public CitCity(Integer citId, String citName)
    {
        this.citId = citId;
        this.citName = citName;
    }

    public Integer getCitId()
    {
        return citId;
    }

    public void setCitId(Integer citId)
    {
        this.citId = citId;
    }

    public String getCitCode()
    {
        return citCode;
    }

    public void setCitCode(String citCode)
    {
        this.citCode = citCode;
    }

    public String getCitName()
    {
        return citName;
    }

    public void setCitName(String citName)
    {
        this.citName = citName;
    }

    public ConCountry getConId()
    {
        return conId;
    }

    public void setConId(ConCountry conId)
    {
        this.conId = conId;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (citId != null ? citId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CitCity))
        {
            return false;
        }
        CitCity other = (CitCity) object;
        if ((this.citId == null && other.citId != null) || (this.citId != null && !this.citId.equals(other.citId)))
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "entities.CitCity[ citId=" + citId + " ]";
    }
    
}
